Release 10.1A: OpenEdge Development:
Progress Dynamics Advanced Development
Defining UI events for the viewer
You can define UI events to which you associate code to execute when the event occurs. This is how you get a user interface trigger in a dynamic object to run procedural code in a custom super procedure that you attach to the object. You can define these events either in the Repository Maintenance tool or, more simply, in the dynamic property sheet.
![]()
To define UI events for the window in the Repository Maintenance tool:
- Open the Repository Maintenance tool.
- Select the dynamic viewer customerviewv and expand it down to its Object Instances. When you expand Object Instances, you see the field-level objects representing all the fields in the viewer.
- Expand the Customer.CreditLimit node to see subnodes for its attributes and for its UI Events.
- Expand the UI Events node to see that none are defined, as shown:
![]()
- Right-click on the UI Events node and select the Add UI Events pop-up button that appears.
The maintenance frame that then appears on the right allows you to define one or more UI events for the CreditLimit field. These are the fields you must fill in:
- Event Name — This is the name of the Progress 4GL event you want to associate code with, for example:
ENTRY,LEAVE,VALUE-CHANGED.- Action Type — Type RUN if you want to run an internal procedure when the event occurs. Type PUBLISH if you want to publish a Progress named event when the UI event occurs (which could be an ADM2 event such as
fetchNextor some named event you have defined yourself, and to which your object subscribes). These are the only two valid values for Action Type.- Action Target — This defines the context in which the event should occur. You can specify one of the values in the following table for the Action Target:
- Event Parameter — This is the value of an optional parameter of type
CHARACTERthat will be passed to the procedure when run or published, if specified. If this is not specified, then the procedure is run or the event is published with noINPUTparameter.- Event Action — This is the name of the internal procedure to be RUN, or the named event to be published.
- Event Disabled — If this toggle box is activated, then the event is disabled and will not occur.
![]()
To define a
LEAVEevent for the CreditLimit field that will execute the same check that happens onRowDisplay:
- Type LEAVE for the Event Name, type RUN for the Action Type, type SELF for the Action Target, and type CreditLimitLeave for the name of the Event Action procedure. Leave the Event Parameter blank and do not activate the Event Disabled toggle box, as shown:
![]()
- Press the Save button to register your event in the Repository.
![]()
To use the Dynamic property sheet to define events:
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |